
const request=require('../../../utils/request.js');
const globleurl = require('../../../utils/serverconfig.js').url;
Page({

  data: {
    movieurl:globleurl+'/姜子牙.jpg'
  },

  onLoad: function (options) {
    let userid=parseInt(options.userid);
    this.setData({
      userid
    });


    this.getmycollect();
  },

  async getmycollect(){
    let collectlist=await request.myrequest('/miniapp/showmycollect',{userid:this.data.userid});
    collectlist=collectlist.data;
    for(let i=0;i<collectlist.length;i++){
      collectlist[i].img_url=globleurl+collectlist[i].img_url;
    };

    this.setData({
      collectlist:collectlist
    })
  },


  showdetail(e){

    let movieid=parseInt(e.currentTarget.dataset.movieid);
    wx.navigateTo({
      url: `../../moviedescription/moviedescription?movie_id=${movieid}`,
    })
  }
 
})